{include file="public/head"/}
<style>
  .main-content {
    margin-left: 0px;
    min-height: 80%;
  }

  .row .cf {
    margin-bottom: 10px;
  }
  .step-content{
    height:560px;
  }
  .well{
    min-height:90%;
  }
</style>


<div class="main-container" id="main-container">
  <script type="text/javascript">
    try {
      ace.settings.check('main-container', 'fixed')
    } catch (e) {
    }
  </script>

  <div class="main-container-inner">
    <a class="menu-toggler" id="menu-toggler" href="#">
      <span class="menu-text"></span>
    </a>
    {include file="public/nav"/}

    <div class="main-content">
      <div class="page-content">
        <div class="row">
          <div class="well">
            <h1 class=" lighter smaller">
              <span class="blue bigger-125">
                <i class="ace-icon fa fa-pencil-square-o"></i>
              </span>
              创建工单
              <a style="font-size:13px;" href="{:url('main/modulefront')}">返回首页</a>
            </h1>
            <hr>
            <div class="space"></div>

            <div class="row-fluid">
              <form class="form-horizontal" id="fmWork" method="post">
                <input type="hidden" name="id" value="">

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">日期</label>
                  <div class="col-sm-9">
                    <input name="date" class="col-xs-10 col-sm-5" value="{$date}" readonly>
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle"></span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">订单号</label>
                  <div class="col-sm-9">
                    <input name="num" class="col-xs-10 col-sm-5" value="{$worknum}" readonly>
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle"></span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">车牌号</label>
                  <div class="col-sm-9">
                    <input readonly name="car_num" class="col-xs-10 col-sm-5">
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">
                        <a href="#modal-tbCars" data-toggle="modal">选择/添加</a>&nbsp;&nbsp;
                        <!--<a href="#modal-fmCars" data-toggle="modal">添加</a>-->
                      </span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">公里数</label>
                  <div class="col-sm-9">
                    <input name="mileage" class="col-xs-10 col-sm-5">
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">

                      </span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right"> 接待 </label>
                  <div class="col-sm-9">
                    <div class="radio">
                    {volist name="reception" id="r"}
                      <label>
                        <input name="reception_id" type="radio" class="ace" value="{$r.id}">
                        <span class="lbl">{$r.name}</span>
                      </label>&nbsp;&nbsp;
                    {/volist}
                    </div>
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle"></span>
                    </span>
                  </div>
                </div>

                <div class="form-group">
                  <label class="col-sm-3 control-label no-padding-right">客户</label>
                  <div class="col-sm-9">
                    <input type="hidden" name="client_id">
                    <input readonly name="client_name" class="col-xs-10 col-sm-5">
                    <span class="help-inline col-xs-12 col-sm-7">
                      <span class="middle">
                        <a href="#modal-tbClients" data-toggle="modal">选择/添加</a>
                      </span>
                    </span>
                  </div>
                </div>

                <div class="col-md-offset-3 col-md-9">
                  <a class="btn btn-info submit" onclick="addWorkSingleForm.saveWork(this);" data-loading-text="保存中...">
                    <i class="icon-ok bigger-110"></i>
                    提交
                  </a>
                  <button class="btn" type="reset">
                    <i class="icon-undo bigger-110"></i>
                    重置
                  </button>
                </div>
              </form>
              <!--选择客户模态框-->
              <div id="modal-tbClients" class="modal" tabindex="-1">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">选择客户</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      <!--客户添加表单-->
                      <form class="form-inline fmClientAdd-hook">
                        <input class="input-small" name="name" placeholder="客户姓名"/>
                        <input class="input-small" name="address" placeholder="地址"/>
                        <input class="input-small" name="phone" placeholder="电话"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addWorkSingleForm.addClient();">
                          <i class="fa fa-plus bigger-110"></i>
                          添加
                        </button>
                        <button type="reset" class="btn btn-primary btn-sm">
                          <i class="fa fa-reply bigger-110"></i>
                          重置
                        </button>
                      </form>
                      <!--数据筛选表单-->
                      <form class="form-inline fmClientQuery-hook">
                        <input class="input-small" name="name" placeholder="客户姓名"/>
                        <input class="input-small" name="address" placeholder="地址"/>
                        <input class="input-small" name="phone" placeholder="电话"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addWorkSingleForm.search();">
                          <i class="fa fa-search bigger-110"></i>
                          查找
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" onclick="addWorkSingleForm.searchNull();">
                          <i class="fa fa-remove bigger-110"></i>
                          清空
                        </button>
                      </form>
                      <!--客户数据表-->
                      <table id="tbClients"></table>
                      <!--客户表页码内容-->
                      <div id="tbClientsPager"></div>
                    </div>
                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <!--<button class="btn btn-sm btn-primary">
                        <i class="icon-ok"></i>
                        保存
                      </button>-->
                    </div>
                  </div>
                </div>
              </div>


              <!--添加客户模态框-->
              <!--<div id="modal-fmClients" class="modal" tabindex="-1">
                <div class="modal-dialog">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button type="button" class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">添加客户信息</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      &lt;!&ndash;添加客户表单&ndash;&gt;
                      <form class="form-horizontal" id="fmClient" method="post">
                        <input type="hidden" name="id" value="">
                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 姓名 </label>
                          <div class="col-sm-9">
                            <input name="name" placeholder="姓名" class="col-xs-10 col-sm-5" value="">
                            <span class="help-inline col-xs-12 col-sm-7">
                              <span class="middle"></span>
                            </span>
                          </div>
                        </div>
                        <div class="space-4"></div>
                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 地址 </label>
                          <div class="col-sm-9">
                            <input name="address" placeholder="地址" class="col-xs-10 col-sm-5" value="">
                            <span class="help-inline col-xs-12 col-sm-7">
                              <span class="middle"></span>
                            </span>
                          </div>
                        </div>
                        <div class="form-group">
                          <label class="col-sm-3 control-label no-padding-right"> 电话 </label>
                          <div class="col-sm-9">
                            <input name="phone" placeholder="电话" class="col-xs-10 col-sm-5" value="">
                            <span class="middle"></span>
                            </span>
                          </div>
                        </div>
                      </form>
                    </div>

                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <button class="btn btn-sm btn-primary" data-loading-text="保存中..." onclick="addWorkSingleForm.saveClient(this);">
                        <i class="icon-ok"></i>
                        保存
                      </button>
                    </div>
                  </div>
                </div>
              </div>-->


              <!--选择车辆模态框-->
              <div id="modal-tbCars" class="modal" tabindex="-1">
                <div class="modal-dialog modal-lg">
                  <div class="modal-content">
                    <div class="modal-header">
                      <button class="close" data-dismiss="modal">&times;</button>
                      <h4 class="blue bigger">选择车辆</h4>
                    </div>
                    <div class="modal-body overflow-visible">
                      <!--数据添加表单-->
                      <form class="form-inline fmCarsAdd-hook">
                        <input class="input-small" name="car_num" placeholder="车牌号"/>
                        <input class="input-small" name="car_type_a" placeholder="年份"/>
                        <input class="input-small" name="car_type_b" placeholder="品牌"/>
                        <input class="input-small" name="car_type_c" placeholder="车型"/>
                        <input class="" name="vin" placeholder="车架号"/>
                        <div class="space-6"></div>
                        <button type="button" class="btn btn-info btn-sm" onclick="addWorkSingleForm.addCar();">
                          <i class="fa fa-plus bigger-110"></i>
                          添加
                        </button>
                        <button type="reset" class="btn btn-primary btn-sm">
                          <i class="fa fa-reply bigger-110"></i>
                          重置
                        </button>
                      </form>
                      <!--数据筛选表单-->
                      <form class="form-inline fmCarsQuery-hook">
                        <input class="input-small" name="car_num" placeholder="车牌号"/>
                        <input class="input-small" name="car_type" placeholder="车型"/>
                        <input class="" name="vin" placeholder="车架号"/>
                        <button type="button" class="btn btn-info btn-sm" onclick="addWorkSingleForm.searchCar();">
                          <i class="fa fa-search bigger-110"></i>
                          查找
                        </button>
                        <button type="button" class="btn btn-primary btn-sm" onclick="addWorkSingleForm.searchNullCar();">
                          <i class="fa fa-remove bigger-110"></i>
                          清空
                        </button>
                      </form>
                      <!--客户数据表-->
                      <table id="tbCars"></table>
                      <!--客户表页码内容-->
                      <div id="tbCarsPager"></div>
                    </div>
                    <div class="modal-footer">
                      <button class="btn btn-sm" data-dismiss="modal">
                        <i class="icon-remove"></i>
                        取消
                      </button>
                      <!--<button class="btn btn-sm btn-primary">
                        <i class="icon-ok"></i>
                        保存
                      </button>-->
                    </div>
                  </div>
                </div>
              </div>
            </div>
            <hr>
            <div class="space"></div>
          </div>
        </div><!-- /.row -->
      </div><!-- /.page-content -->
    </div><!-- /.main-content -->

  </div><!-- /.main-container-inner -->

  <a href="#" id="btn-scroll-up" class="btn-scroll-up btn btn-sm btn-inverse">
    <i class="icon-double-angle-up icon-only bigger-110"></i>
  </a>
</div>
<!-- /.main-container -->
{include file="public/footerjs"/}
<script>
  var addworksingleform_urls={
    getCars:"{:url('car/getCar')}",
    getClients:"{:url('client/getClients')}",
    getLinkedClient:"{:url('work/getLinkedClient')}",
    addClient:'{:url("client/doAdd")}',
    addCar:'{:url("car/doAdd")}',
    addWork:'{:url("work/doAdd")}',
    indexWork:"{:url('indexWork')}",
    mainMenu:"{:url('main/modulefront')}",
  }
</script>
<script src="__ADMIN__/js/work/addworksingleform.js"></script>
{include file="public/foot"/}
